package com.aokang.footwear.common.exception;

import com.aokang.footwear.common.i18n.IErrorCodeEnum;
import lombok.Getter;

/**
 * @author chilei
 * 基础业务异常
 */
@Getter
public class BaseServiceException extends RuntimeException {

    private IErrorCodeEnum iErrorCodeEnum;
    private int code;
    private Object responseData;

    public BaseServiceException(IErrorCodeEnum iErrorCodeEnum) {
        super(iErrorCodeEnum.getMsg());
        this.iErrorCodeEnum = iErrorCodeEnum;
    }

    public BaseServiceException(IErrorCodeEnum iErrorCodeEnum, Object responseData) {
        super(iErrorCodeEnum.getMsg());
        this.iErrorCodeEnum = iErrorCodeEnum;
        this.responseData = responseData;
    }

    public BaseServiceException(int code, String msg) {
        super(msg);
        this.code = code;
    }
}
